#include <stdio.h>
#include <stdlib.h>

#define MAX_LEN 30

int d[MAX_LEN];
int N = 0;

void fn()
{
    int spos = 0, ssum = d[spos];
    int epos = N-1, esum = d[epos];

    while(1)
    {
        if(spos+1 == epos)
        {
            break;
        }
        if(ssum < esum)
        {
            ssum += d[++spos];
        }
        else if(ssum > esum)
        {
            esum += d[--epos];
        }
        else
        {
            ssum += d[++spos];
        }
    }
    if(ssum == esum)
    {
        printf("Sam stops at position %d and Ella stops at position %d.\r\n", spos+1, epos+1);
    }
    else
    {
        printf("No equal partitioning.\r\n");
    }

}

void process()
{
    int i = 0;
    scanf("%d", &N);
    while(N != 0)
    {
        for(i = 0; i < N; i++)
        {
            scanf("%d", &d[i]);
        }

        fn();

        scanf("%d", &N);
    }
}

int main()
{
    //freopen("bin\\debug\\in.txt", "r", stdin);

    process();

    return 0;
}
